<template>
  <div>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="30%"
      :before-close="handleClose"
    >
      <span>这是一段信息</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleClose">取 消</el-button>
        <el-button type="primary" @click="handleok">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {};
  },
  methods: {
    handleClose() {
      this.$emit("close");
    },
    handleok() {
      console.log("okokokokoko");
      axios
        .get("http://localhost:8080/user/users")
        .then((res) => {
          console.log("user", res);
          this.$emit("close");
        })
        .catch((err) => {
          console.log("err", err);
        });
    },
  },
  props: {
    dialogVisible: {
      type: Boolean,
      default: false,
    },
  },
};
</script>